Skip to content

fix(investigation): declare ranges for numeric CLI options (#1562) - #1673

Open
Mohit-Gaur75 wants to merge 1 commit into
pyrite-wiki:devfrom
Mohit-Gaur75:fix/1562-investigation-numeric-ranges
Open

Mohit-Gaur75 wants to merge 1 commit into
pyrite-wiki:devfrom
Mohit-Gaur75:fix/1562-investigation-numeric-ranges

Conversation

@Mohit-Gaur75

Copy link
Copy Markdown
Contributor

Resolves #1562. Follows #1541.

Description

Declares the valid numeric ranges for all 13 numeric options across pyrite investigation CLI commands:

  • imeline: --min-importance (min=0, max=10), --limit (min=1)
  • entities: --min-importance (min=0, max=10), --limit (min=1)
  • sources: --limit (min=1)
  • claims: --min-importance (min=0, max=10), --limit (min=1)
  • qa: --stale-days (min=0)
  • search: --limit (min=1)
  • ownership: --depth (min=1)
  • money-flow: --hops (min=1)
  • export: --min-importance (min=0, max=10)
  • dedup: --threshold (min=0.0, max=1.0)

Removes all 13 rows from NOT_YET in ests/test_cli_numeric_options_declare_a_range.py and decrements NOT_YET_PINNED_SIZE from 29 to 16.

Adds unit tests in extensions/journalism-investigation/tests/test_cli_option_ranges.py asserting that out-of-range inputs exit with code 2 and print usage error messages naming the option.

Changelog: fixed

@markramm markramm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking #1562 and for removing exactly the rows you bounded.

Blocking

None found. The 13 options you bounded match the 13 NOT_YET rows you removed (timeline 2, entities 2, sources 1, claims 2, qa 1, search 1, ownership 1, money-flow 1, export 1, dedup 1), and NOT_YET_PINNED_SIZE goes 29 to 16, which is 29 minus 13, so the ratchet still balances by my reading.

Non-blocking

  • cli.py (timeline, entities, claims, export): --min-importance now accepts 0 to 10, but the help text still says "(1-10)". 0 is the default and means "no filter", so the range is right; please change the help to "(0-10, 0 = no filter)".
  • changelog.d/1562-investigation-numeric-ranges.fixed.md: it lists the new ranges but not the old answer. Add one clause such as "--limit 0 and negative values were passed through to the query" so a reader knows what changed.
  • tests/test_cli_numeric_options_declare_a_range.py: open PR #1614 deletes NOT_YET_PINNED_SIZE and changes this file, so your NOT_YET_PINNED_SIZE = 16 edit will conflict textually with it (the row removals are a few lines away and may merge). Whichever lands second drops the pin line; we will sort that out at merge, nothing for you to do now.
  • tests/test_cli_option_ranges.py: it checks exit code 2 and the option name only. Add one valid boundary case (--limit 1, --min-importance 10) so a range tightened too far is also caught.

Recommendation: merge.

@markramm markramm added the state: needs-maintainer Reviewed clean; the maintainer merges (storage, server, schema or a public shape) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: needs-maintainer Reviewed clean; the maintainer merges (storage, server, schema or a public shape)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyrite investigation numeric options (limits, importance, depth, hops, threshold) accept values outside their range (declare the ranges; #1541)

2 participants